<?php
/**
 *
 * @file Pipeline.php
 *
 * @todo brief.
 *
 * @todo details here
 *
 * http://code.google.com/p/rpd/wiki/Pipeline.php
 *
 * New BSD License
 * \n
 * Copyright (c) 2010 Rpd-Team
 *
 * @namespace  rpd
 * @since      0.1.0
 */

/**
 * Interface for pipeline classes
 * @since  0.1.0
 *
 * Every class that implements the Pipeline-Interface can get different
 * type of data to let em do what they are supposed to. See some examples
 * for Model, View and Controller to know how to push data.
 *
 * @section Changelog
 *
 * <table>
 * 	<tr>
 * 		<th>Version</th>
 * 		<th>Description</th>
 *  </tr>
 *  <tr><td>0.1.1</td><td>Added Pipeline::pipe() - alias of Pipeline::__invoke()</td></tr>
 * </table>
 *
 *
 * @section Examples
 *
 * @subsection Pipeline-View Push submitted form into View
 *
 * After some data has been sended via form we want to show them once more
 * in a view.
 *
 * <pre>Content of $_POST</pre>
 * @verbatim ["username"] => "Foo" @endverbatim
 *
 * <pre>/app/View/show_data.php</pre>
 * @code
 * Your name is: <?=$username?>
 * @endcode
 *
 * <pre>/app/Controller/index.php</pre>
 * @code
 * <?php
 *
 * $view = new View("show_data");	// get the view
 * echo $view($_POST);				// pipe the submitted informations in it
 *
 * ?>
 * @endcode
 *
 * \warning{
 * 	You need PHP 5.3.0 or above,
 *  Below PHP 5.3.0 you'll have to write "$view->__invoke($_POST);" instead.
 * }
 *
 * @see Controller
 * @see View
 *
 */
interface Pipeline {

	/**
	 * Pipes some output into class
	 *
	 * @since 0.1.0
	 *
	 * @param Object $in Class or ouput of another object
	 *
	 * @return Depends on class itself (default: $this)
	 *
	 * @section Changelog
	 *
	 * <table>
	 * 	<tr>
	 * 		<th>Version</th>
	 * 		<th>Description</th>
	 *  </tr>
	 *  <tr><td></td><td></td></tr>
	 * </table>
	 *
	 */
	public function __invoke($in);

	/**
	 * Alias of Pipeline::__invoke()
	 * @copydoc Pipeline::__invoke()
	 */
	public function pipe($in);
}

?>